package com.yuyou.fn.settlement.service;

import com.github.wens.framework.service.ISuperService;
import com.github.wens.mybatisplus.plugins.Page;
import com.yuyou.fn.settlement.entity.ChangeRecord;
import com.yuyou.fn.settlement.vo.ChangeRecordQueryVo;
import com.yuyou.fn.settlement.vo.MainAccountAmountVo;
import com.yuyou.fn.settlement.vo.MainAccountCategoryAmountVo;
import com.yuyou.fn.settlement.vo.MainAccountTimeAmountVo;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 *
 * ChangeRecord 表数据服务层接口
 *
 */
public interface IChangeRecordService extends ISuperService<ChangeRecord,Long> {


    List<ChangeRecord> findNotSettleChangeRecord(Long mainAccountId, String subject, Date start, Date end);

    void updateSettleStatus(List<Long> changeRecordIdList, int settleStatus);

    List<ChangeRecord> findChangeRecordByTrackingIdSubject(Long trackingId , String subject, Long mainAccountId);

    BigDecimal sumBySubjectDirection(Long mainAccountId , int direction , String subject, Date start, Date end);

    BigDecimal sumBySubjectCategoryDirection(Long mainAccountId , int direction , String subject,Long categoryId, Date start, Date end);

    List<ChangeRecord> findByMainAccountIdsTimeDirectionSubject(List<Long> mainAccountIds, Date startDate, Date endDate, Integer driection, String subject,String ...columns);

    List<ChangeRecord> findByCategoryId(int direction,String subject,Date startDate,Date endDate,Long categoryId);

    List<ChangeRecord> findByCategoryIdAndMainAccountId(Long mainAccountId,int direction,String subject,Date startDate,Date endDate,Long categoryId);

    Page<ChangeRecord> findPageByQueryVo(ChangeRecordQueryVo changeRecordQueryVo,int pageNo,int pageSize);

    List<ChangeRecord> findByCategoryIdsAndMainAccountIds(List<Long> mainAccountIds, int direction, String subject, Date startDate, Date endDate, List<Long> categoryIds);



    List<ChangeRecord> findChangeRecordByTrackingIdSubjectCategoryId(Long trackingId, String subject, long categoryId);

    List<MainAccountTimeAmountVo> findMonthAmount(ChangeRecordQueryVo changeRecordQueryVo);

    List<MainAccountAmountVo> findMainAccountAmount(ChangeRecordQueryVo changeRecordQueryVo);

    List<MainAccountCategoryAmountVo> findMainAccountCategoryAmount(ChangeRecordQueryVo changeRecordQueryVo);
}